﻿<html xmlns:th="http://www.thymeleaf.org">
<head>
    <!--资源获取-->
    <base th:href="|${#request.getContextPath()}/|">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/lib/html5shiv.js"></script>
    <script type="text/javascript" src="static/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="static/lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="static/lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <!--layui-->
    <link rel="stylesheet" type="text/css" href="static/layui/css/layui.css"/>
    <script type="text/javascript" src="static/layui/layui.js"></script>
    <title>资讯列表</title>
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
    首页
    <span class="c-gray en">&gt;</span>
    博客
    <span class="c-gray en">&gt;</span>
    热门博客
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
    <!--收藏-->
    <a id="djsc" class="btn btn-success radius r " style="line-height:1.6em;margin-top:3px" href="javascript:;"
       title="收藏">
        <i id="sc" class="layui-icon"></i>
    </a>
    <!--收藏-->
</nav>
<div class="page-container">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
        <legend>记录点滴成长</legend>
    </fieldset>

    <div class="layui-row layui-col-space30">

        <!--博客列表sts-->
        <div class="layui-col-xs6 layui-col-sm7 layui-col-md8">
            <div class="layui-row layui-col-space15">
                <div id="posts" class="layui-row layui-col-space15">

                </div>
                <!--分页-->
                <div class="layui-col-xs12">
                    <div id="fenye"></div>
                </div>
            </div>
        </div>

        <!--博客列表end-->
        <div class="layui-col-xs6 layui-col-sm5 layui-col-md4">
            <!--搜索文章sts-->
            <div class="layui-card">
                <div class="layui-card-header layui-bg-blue">搜索文章</div>
                <div class="layui-card-body">
                    <div class="layui-row layui-col-space15">
                        <div class="layui-col-xs8 layui-col-sm8 layui-col-md8">
                            <input id="title" type="text" name="title" required lay-verify="required"
                                   placeholder="请输入标题"
                                   autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
                            <button type="button" id="sousuo" class="layui-btn layui-btn-normal layui-btn-fluid">搜索</button>
                        </div>
                    </div>
                </div>
            </div>
            <!--搜索文章end-->
            <!--热门标签sts-->
            <div class="layui-card">
                <div class="layui-card-header layui-bg-blue">热门标签</div>
                <div class="layui-card-body">
                    <div class="layui-row layui-col-space15">
                        <div id="rmbq" class="layui-col-xs12">
                        </div>
                        <div class="layui-col-xs12">
                            <button id="chongzhi" class="layui-btn layui-btn-normal  layui-btn-sm ">重置</button>
                        </div>
                    </div>
                </div>
            </div>
            <!--热门标签end-->
        </div>
    </div>
</div>
<script type="text/javascript" src="static/lib/jquery/1.9.1/jquery.min.js"></script>

<script type="text/javascript" src="static/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/lib/laypage/1.2/laypage.js"></script>


<script type="text/javascript" src="static/my/js/post.js"></script>
<script type="text/javascript" src="static/my/js/util.js"></script>
<script>

    /*收藏按钮*/
    var ejhref = "post/posts";//收藏路径
    var ejhrefname = "热门博客"
    ccscym(ejhref)
    $("#djsc").on("click", function (){
        scym(ejhref, ejhrefname)
    })
    /*收藏按钮*/



    //点击重置
    $("#chongzhi").click(function () {
        $("button[name='postbq']").each(function(){
            $(this).remove("layui-border-blue").addClass("layui-border-black");
        });
        mylaypage();
    })
    //点击搜索
    $("#sousuo").click(function () {
        mylaypage();
    })
    //博客分页
    //总页数
    var counts ;
    function mylaypage(postS){
        layui.use(['laypage', 'layer'], function () {
            var laypage = layui.laypage
                , layer = layui.layer;

            var postStatu = (postS!=null||postS!="")?postS:1;
            laypage.render({
                elem: 'fenye'
                , theme: '#1E9FFF'
                ,count: selectcounts(postStatu)
                , jump: function (obj) {
                    //console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
                    //console.log(obj.limit); //得到每页显示的条数
                    posts(obj.curr,obj.limit,postStatu);
                    console.log("查询成功")
                }
                ,layout: ['count','prev', 'page', 'next', 'limit', 'refresh', 'skip']
            });
        });
    }
    mylaypage();
    bqcx();

    //点击标签
    $("button[name='postbq']").click(function(){
        $(this).toggleClass("layui-border-blue").toggleClass("layui-border-black");
        mylaypage();
    });

</script>

<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/lib/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="static/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="static/lib/datatables/1.10.15/jquery.dataTables.min.js"></script>
<script type="text/javascript">


</script>

</body>
</html>
